if (session.tls)
  div.sessionDetailMeta.bold TLS
  dl.sessionDetailMeta
    +arrayList(session.tls, "version", "Version", "tls.version")
    +arrayList(session.tls, "cipher", "Cipher", "tls.cipher")
    +arrayList(session.tls, "srcSessionId", "Src Session Id", "tls.sessionid.src")
    +arrayList(session.tls, "dstSessionsId", "Dst Session Id", "tls.sessionid.dst")
    +arrayList(session.tls, "ja3", "JA3", "tls.ja3")
    +arrayList(session.tls, "ja3Comment", "JA3 Comment", "tls.ja3comment")
    +arrayList(session.tls, "ja3s", "JA3s", "tls.ja3s")

if (session.cert)
  div.sessionDetailMeta.bold Cert
  dl.sessionDetailMeta
  each cert in session.cert
    dt Certificate
    dd
      - if (cert.sn)
        strong.medium.ml-1 Serial
        moloch-session-field.detail-field(:expr="'cert.serial'", :value='"'+cert.sn+'"', :field="fields['cert.serial']", :pull-left="true")
      - if (cert.hash)
        | [
        moloch-session-field.detail-field(:expr="'cert.hash'", :value='"'+cert.hash+'"', :field="fields['cert.hash']", :pull-left="true")
        |]
      - if (cert.notBefore)
        strong.medium.ml-1 Not Before
        moloch-session-field.detail-field(:expr="'cert.notbefore'", :value='"'+cert.notBefore+'"', :field="fields['cert.notbefore']", :pull-left="true")
      - if (cert.notAfter)
        strong.medium.ml-1 Not After
        moloch-session-field.detail-field(:expr="'cert.notafter'", :value='"'+cert.notAfter+'"', :field="fields['cert.notafter']", :pull-left="true")
      - if (cert.issueCN && Array.isArray(cert.issueCN))
        strong.medium.ml-1 Issuer Common
        each cn,i in cert.issueCN
          if (i > 0)
            |,
          moloch-session-field.detail-field(:expr="'cert.issuer.cn'", :value='"'+cn+'"', :field="fields['cert.issuer.cn']", :pull-left="true")
      - else if (cert.issueCN)
        strong.medium.ml-1 Issuer Common
        moloch-session-field.detail-field(:expr="'cert.issuer.cn'", :value='"'+cert.issueCN+'"', :field="fields['cert.issuer.cn']", :pull-left="true")
      - if (cert.issuerON && Array.isArray(cert.issuerON))
        strong.medium.ml-1 Issuer Org
        each on,i in cert.issuerON
          if (i > 0)
            |,
          moloch-session-field.detail-field(:expr="'cert.issuer.on'", :value='"'+on+'"', :field="fields['cert.issuer.on']", :pull-left="true")
      - else if (cert.issuerON)
        strong.medium.ml-1 Issuer Org
        moloch-session-field.detail-field(:expr="'cert.issuer.on'", :value='"'+cert.issuerON+'"', :field="fields['cert.issuer.on']", :pull-left="true")
      - if (cert.subjectCN && Array.isArray(cert.subjectCN))
        strong.medium.ml-1 Subject Common
        each cn,i in cert.subjectCN
          if (i > 0)
            |,
          moloch-session-field.detail-field(:expr="'cert.subject.cn'", :value='"'+cn+'"', :field="fields['cert.subject.cn']", :pull-left="true")
      - else if (cert.subjectCN)
        strong.medium.ml-1 Subject Common
        moloch-session-field.detail-field(:expr="'cert.subject.cn'", :value='"'+cert.subjectCN+'"', :field="fields['cert.subject.cn']", :pull-left="true")
      - if (cert.subjectON && Array.isArray(cert.subjectON))
        strong.medium.ml-1 Subject Org
        each on,i in cert.subjectON
          if (i > 0)
            |,
          moloch-session-field.detail-field(:expr="'cert.subject.on'", :value='"'+on+'"', :field="fields['cert.subject.on']", :pull-left="true")
      - else if (cert.subjectON)
        strong.medium.ml-1 Subject Org
        moloch-session-field.detail-field(:expr="'cert.subject.on'", :value='"'+cert.subjectON+'"', :field="fields['cert.subject.on']", :pull-left="true")
      - if (cert.alt)
        | [
        each alt,i in cert.alt
          if (i > 0)
            |,
          moloch-session-field.detail-field(:expr="'cert.alt'", :value='"'+alt+'"', :field="fields['cert.alt']", :pull-left="true")
        |]
      - if (cert.publicAlgorithm)
        strong.medium.ml-1 Public Algorithm
        moloch-session-field.detail-field(:expr="'cert.publicAlgorithm'", :value='"'+cert.publicAlgorithm+'"', :field="fields['cert.publicAlgorithm']", :pull-left="true")
      - if (cert.curve)
        strong.medium.ml-1 Curve
        moloch-session-field.detail-field(:expr="'cert.curve'", :value='"'+cert.curve+'"', :field="fields['cert.curve']", :pull-left="true")
